<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title></title>
  </head>
  <body></body>
  <script>
    //原型的继承，而不是改变构造函数的原型
    function User() {}
    User.prototype.name = function() {
      console.log("user.name");
    };

    function Admin() {}
    Admin.prototype = Object.create(User.prototype);//等同于Admin.prototyp.__proto__ = User.prototype
    
    // Admin.prototype.constructor = Admin;
    Object.defineProperty(Admin.prototype, "constructor", {
      value: Admin,
      enumerable: false
    });
    Object.defineProperties(Admin.prototype,{
      constructor:{
        value: Admin,
      enumerable: false
      }
    })






    













    // console.log(Object.getOwnPropertyDescriptors(Admin.prototype));
    Admin.prototype.role = function() {
      console.log("admin.role");
    };
    let a = new Admin();
    console.log(a);
    for (const key in a) {
      console.log(key); 
    }
    class Usera {};
    let   aa = Object.create(Usera.prototype)
    console.log(aa);
  </script>
</html>
